<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 申诉数据表迁移
 *
 * Date: 2018/6/22
 * @author George
 */
class CreateAppealsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('appeals', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('company_id')->index()->comment('公司ID');
            $table->unsignedInteger('project_id')->index()->comment('项目ID');
            $table->unsignedInteger('attendance_id')->index()->comment('考勤ID');
            $table->unsignedInteger('schedule_id')->index()->comment('排班ID');
            $table->unsignedInteger('user_id')->index()->comment('用户ID');
            $table->string('type')->comment('申述类型');
            $table->string('content')->comment('内容');
			$table->string('status')->default('pending')->comment('状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('appeals');
    }
}
